package io;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class PWDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("pw.txt");//文件流（低级流）
        OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        BufferedWriter bw = new BufferedWriter(osw);//缓冲字符流（高级流）
        PrintWriter pw = new PrintWriter(bw);
        pw.println("啦啦啦啦");
        pw.println("咿呀咿呀哟");
        System.out.println("写出完毕");
        pw.close();
    }
}
